<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'app-categories-form',
	'enableAjaxValidation'=>false,
)); ?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php echo $form->errorSummary($model); ?>

	<div class="row">
		<?php echo $form->labelEx($model,'category_code'); ?>
		<?php echo $form->textField($model,'category_code',array('size'=>4,'maxlength'=>4)); ?>
		<?php echo $form->error($model,'category_code'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'category_name'); ?>
		<?php echo $form->textField($model,'category_name',array('size'=>30,'maxlength'=>30)); ?>
		<?php echo $form->error($model,'category_name'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'platform_type'); ?>
		<?php
			if($flag =='create'){
				unset($appsPlatType[array_search('iphone' , $appsPlatType)]) ;
				echo $form->dropDownList($model , 'platform_type' , $appsPlatType ,array('prompt'=>'iphone') ) ;
			}
			else if($flag =='update'){
				unset($appsPlatType[array_search($model->platform_type, $appsPlatType)]) ;
				echo $form->dropDownList($model , 'platform_type' , $appsPlatType , array('prompt'=>$model->platform_type) ) ;
			}
		?>
		<?php echo $form->error($model,'platform_type'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'app_type'); ?>
		<?php
			if($flag =='create'){
				unset($appsType[array_search('app' , $appsType)]) ;
				echo $form->dropDownList($model , 'app_type' , $appsType ,array('prompt'=>'app') ) ;
			}
			else if($flag =='update'){
				unset($appsType[array_search($model->app_type, $appsType)]) ;
				echo $form->dropDownList($model , 'app_type' , $appsType , array('prompt'=>$model->app_type) ) ;
			}
		?>
		<?php echo $form->error($model,'app_type'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'description'); ?>
		<?php echo $form->textArea($model,'description',array('rows'=>6, 'cols'=>50)); ?>
		<?php echo $form->error($model,'description'); ?>
	</div>

	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->